package com.dragon.dragonshop.aspect;


import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class TestAspect {

    @Pointcut("execution(public * com.dragon.dragonshop.service.impl.*.*(..))")
    public void test(){}

    @Before("execution(public * com.dragon.dragonshop.service.impl.UserServiceImpl.hasUser(..))"+"&&args(userName)")
    public void before(String userName){
        System.out.println("================dragon ++++++"+userName+" ====================before");
    }

    @AfterReturning("test()")
    public void afterReturning(){
        System.out.println("================dragon  ====================afterReturning");
    }


}
